package Action;

import Model.User;

public class login extends BaseAjax {

    @Override
    public Object doHandle() {
        String email = this.getForm("email");
        String password = this.getForm("password");
        User user = User.login(email, password);
        if (user == null) {
            return "Unable to login!";
        }
        this.setSession("loginId", user.id);
        return user.id;
    }
}